package com.woniu.finance.contorller;


import com.woniu.aop.OperationLogAnnotation;
import com.woniu.finance.entity.RoleMenu;
import com.woniu.finance.service.IRoleMenuService;
import com.woniu.util.utils.HttpResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 角色菜单表 前端控制器
 * </p>
 *
 * @author 鹏
 * @since 2023-05-05
 */
@RestController
@RequestMapping("/finance/role-menu")
public class RoleMenuController {

    @Autowired(required = false)
    private IRoleMenuService roleMenuService;

    @PostMapping("/saveRoleMenu")
    @OperationLogAnnotation(operModul = "融资企业-角色菜单表",operType = "新增",operDesc = "新增角色菜单表")//操作日志注解
    public HttpResult<?> saveRoleMenu(@RequestBody RoleMenu roleMenu){
        return roleMenuService.saveRoleMenu(roleMenu);
    }

    @RequestMapping("/removeRoleMenu")
    @OperationLogAnnotation(operModul = "融资企业-角色菜单表",operType = "删除",operDesc = "删除角色菜单表")//操作日志注解
    public HttpResult<?> removeRoleMenu(Integer id){
        return roleMenuService.removeRoleMenu(id);
    }

    @PostMapping("/modifyRoleMenu")
    @OperationLogAnnotation(operModul = "融资企业-角色菜单表",operType = "修改",operDesc = "修改角色菜单表")//操作日志注解
    public HttpResult<?> modifyRoleMenu(@RequestBody RoleMenu roleMenu){
        return roleMenuService.modifyRoleMenu(roleMenu);
    }

    @RequestMapping("/findAllRoleMenu")
    @OperationLogAnnotation(operModul = "融资企业-角色菜单表",operType = "查询",operDesc = "查询所有角色菜单表")//操作日志注解
    public HttpResult<?> findAllRoleMenu(){
        return roleMenuService.findAllRoleMenu();
    }

    @RequestMapping("/findAllRoleMenuById")
    @OperationLogAnnotation(operModul = "融资企业-角色菜单表",operType = "查询",operDesc = "根据id查询角色菜单表")//操作日志注解
    public HttpResult<?> findAllRoleMenuById(Integer id){
        return roleMenuService.findRoleMenuById(id);
    }
}
